<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>pyswap: modem::SerialPort::SerialPort Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="panStamp_web.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">pyswap
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>modem</b>      </li>
      <li class="navelem"><b>SerialPort</b>      </li>
      <li class="navelem"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html">SerialPort</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-attribs">Public Attributes</a>  </div>
  <div class="headertitle">
<div class="title">modem::SerialPort::SerialPort Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="modem::SerialPort::SerialPort" -->
<p>Wrapper class of the pyserial package.  
 <a href="classmodem_1_1SerialPort_1_1SerialPort.html#details">More...</a></p>

<p><a href="classmodem_1_1SerialPort_1_1SerialPort-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a98c407e6f65c08a85871f05ad6c9b183"></a><!-- doxytag: member="modem::SerialPort::SerialPort::run" ref="a98c407e6f65c08a85871f05ad6c9b183" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#a98c407e6f65c08a85871f05ad6c9b183">run</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Run serial port listener on its own thread. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af11669b5eae5d133e7e2837a423fcbd3"></a><!-- doxytag: member="modem::SerialPort::SerialPort::stop" ref="af11669b5eae5d133e7e2837a423fcbd3" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#af11669b5eae5d133e7e2837a423fcbd3">stop</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop serial port. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#ac64f6d5f14ad639bad126c626163c1a9">send</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Send string buffer via serial.  <a href="#ac64f6d5f14ad639bad126c626163c1a9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#ae6e74c12db384f0173cabe6c4428d1ca">setRxCallback</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set callback reception function.  <a href="#ae6e74c12db384f0173cabe6c4428d1ca"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a25ae8857b41af23d12152c7f9da43888"></a><!-- doxytag: member="modem::SerialPort::SerialPort::reset" ref="a25ae8857b41af23d12152c7f9da43888" args="" -->
def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#a25ae8857b41af23d12152c7f9da43888">reset</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Hardware reset serial modem. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">def&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#a54bb038fd9c3a857dd5d863a760f2d26">__init__</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Class constructor.  <a href="#a54bb038fd9c3a857dd5d863a760f2d26"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="pub-attribs"></a>
Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a648989fec3795c80525896bcf1d4e0d7"></a><!-- doxytag: member="modem::SerialPort::SerialPort::serial_received" ref="a648989fec3795c80525896bcf1d4e0d7" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#a648989fec3795c80525896bcf1d4e0d7">serial_received</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Callback Rx function. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa242a7f4ea867a912687be9123b8d248"></a><!-- doxytag: member="modem::SerialPort::SerialPort::portname" ref="aa242a7f4ea867a912687be9123b8d248" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#aa242a7f4ea867a912687be9123b8d248">portname</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Name(path) of the serial port. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6b77c4c2f7c382cfa5a02e14f5291ac3"></a><!-- doxytag: member="modem::SerialPort::SerialPort::portspeed" ref="a6b77c4c2f7c382cfa5a02e14f5291ac3" args="" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmodem_1_1SerialPort_1_1SerialPort.html#a6b77c4c2f7c382cfa5a02e14f5291ac3">portspeed</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Speed of the serial port in bps. <br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Wrapper class of the pyserial package. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a54bb038fd9c3a857dd5d863a760f2d26"></a><!-- doxytag: member="modem::SerialPort::SerialPort::__init__" ref="a54bb038fd9c3a857dd5d863a760f2d26" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def modem::SerialPort::SerialPort::__init__ </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>portname</em> = <code>&quot;/dev/ttyUSB0&quot;</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>speed</em> = <code>38400</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>verbose</em> = <code>False</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Class constructor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">portname,:</td><td>Name/path of the serial port </td></tr>
    <tr><td class="paramname">speed,:</td><td>Serial baudrate in bps </td></tr>
    <tr><td class="paramname">verbose,:</td><td>Print out SWAP traffic (True or False) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac64f6d5f14ad639bad126c626163c1a9"></a><!-- doxytag: member="modem::SerialPort::SerialPort::send" ref="ac64f6d5f14ad639bad126c626163c1a9" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def modem::SerialPort::SerialPort::send </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>buf</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Send string buffer via serial. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">buf,:</td><td>Packet to be transmitted </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ae6e74c12db384f0173cabe6c4428d1ca"></a><!-- doxytag: member="modem::SerialPort::SerialPort::setRxCallback" ref="ae6e74c12db384f0173cabe6c4428d1ca" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">def modem::SerialPort::SerialPort::setRxCallback </td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>self</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname"><em>cb_function</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set callback reception function. </p>
<p>This function is called whenever a new serial packet is received from the gateway</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">cb_function,:</td><td>User-defined callback function </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>/home/daniel/development/Aptana/pyswap/src/modem/SerialPort.py</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Fri Dec 9 2011 16:23:27 for pyswap by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
